package action.querywork;

import javax.servlet.http.HttpServletRequest;

import model.Work;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ActionSupport;

import service.queryWorkService;

@Namespace("")
@Action(
	value="StuquerySingleWork",
	results={
			@Result(name="success",location="/WEB-INF/checkDetail.jsp")
	}		
)
public class StuquerySingleWork extends ActionSupport{
	private String work_id;
	public String execute() throws  Exception{
		Work work=new Work();
		queryWorkService qws=new queryWorkService();
		work=qws.querySingleWork(Integer.parseInt(getWork_id()));
	
		HttpServletRequest request=ServletActionContext.getRequest();
		request.setAttribute("WorkDetail", work);
		return SUCCESS;
	}
	public String getWork_id() {
		return work_id;
	}
	public void setWork_id(String work_id) {
		this.work_id = work_id;
	}

}
